<?php

namespace Trois\Init\Inits;

use EasySwoole\Component\Di;
use EasySwoole\Component\Singleton;
use Trois\Design\Observer\IObserver;
use Trois\Lib\Help;

class DiInit implements IObserver
{
    use Singleton;

    protected array $class = [

    ];

    public function update()
    {
        foreach ($this->class as $class) {
            Di::getInstance()->set(Help::classBasename($class), $class::getInstance());
        }

    }
}